import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [uni()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    },
    extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
  },
  server: {
    host: '0.0.0.0',
    port: 6019,
    hmr: true, // 热更新
    open: false, // 浏览器自动打开
    https: false, // 是否开启 https
    strictPort: true // 端口被占用时直接退出
  },
  css: {
    preprocessorOptions: {
      scss: {
        // api: 'modern' // or "modern", "legacy"
        silenceDeprecations: ['legacy-js-api']
      }
    }
  }
});
